home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / ucturbo2 / wtest.c < prev   
Text File  |  1987-05-23  |  2KB  |  83 lines

  1. #include <stdio.h>
  2. #include <window.h>
  3. #include <border.h>
  4.  
  5. int insert;
  6.  
  7. main()
  8. {
  9.    WINDOW *wn, *wn1, *wn2, *wopen();
  10.    char a[80];
  11.    char b[80];
  12.  
  13.  
  14.    bdr21.att = 0x014;
  15.  
  16. insert = 0;
  17.  
  18. if ((wn = wnopen(&bdr21, 10,2,60,10, 0x01e)) == NULL)
  19. {
  20.    printf("\n--- Error opening window wn\n");
  21.    exit(1);
  22. }
  23. hidecur();
  24. wnputs(wn, "\r\n                Unicorn Software                   \r\n");
  25. wnputs(wn, "                  is proud to present\r\n");
  26. wnputs(wn, "  The Unicorn Window functions.  Many functions are \r\n");
  27. wnputs(wn, "  available for your pleasure.  Type your name please\r\n");
  28. wnputs(wn, "\r\n\Press any key to continue.\r\n");
  29. showcur();
  30. wnputs(wn, "Your name is - ");
  31. gets(a);
  32. wngets(wn, b, 8);
  33.  
  34. if ((wn2 = wnopen(&bdr12, 15,13,30,5, 0x05f)) == NULL)
  35. {
  36.    printf("\n--- Error opening window wn2\n");
  37. }
  38. hidecur();
  39. wnputs(wn2, "This is window wn2\r\n");
  40. wnputs(wn2, "Hello there  ");
  41. wnputs(wn2, b);
  42. wnputs(wn2, ", How\r\nare you today?");
  43. wnputs(wn2, "\r\n\r\nPress any key to continue.\r\n");
  44. gets(a);
  45.  
  46.  
  47. if ((wn1 = wnopen(&bdr1r, 5,5,70,9, 0x04c)) == (WINDOW *) NULL)
  48. {
  49.    printf("\n--- Error opening window wn1\n");
  50. }
  51.  
  52. hidecur();
  53. wnputs(wn1, "This is window wn1\r\n");
  54. wnputs(wn1, "Press any key to continue.\r\n");
  55. gets(a);
  56. wnclose(wn1);
  57. gets(a);
  58. wnclose(wn2);
  59.  
  60.  
  61. wnputs(wn, "\r\nBack in  window wn now press any key to\r\n");
  62. wnputs(wn, "Return to dos\r\n");
  63. gets(a);
  64. wnclose(wn);
  65. showcur();
  66.  
  67. }
  68.  
  69.  
  70. hidecur()
  71. {
  72.   wsetcurt(10,9);
  73. }
  74.  
  75.  
  76. showcur()
  77. {
  78.   wsetcurt(6,7);
  79. }
  80.  
  81.  
  82.  
  83.